<?php
HBase::using('Backend.*');
class backend_users_edit extends HModule {
	public $data;
	function run(){
		if (isset($_POST['flag'])) {
			self::process();
		}
		else {
			$this->data = HUsers::getOneUserById($_GET['id']);					
		}
	}
	
	function process() {
		$id 	= $_GET['id'];
		$email 	= $_POST['tbxEmail'];
		if (HUsers::update($id,$email)){
			HUtil::alert("Update user successfully!");
		}else{ 
			HUtil::alert("ERROR: Update users unsuccessfully!");
		}
		HUtil::redirect(HCommon::navigateUrl('Users'));			
	}
}
?>